package datalayer;

import java.sql.*;
import java.util.ArrayList;

import Lijsten.VogelLijst;
import model.*;


public class VogelLayer extends Datalayer{
	
	private int pelikaanteller;
	
	public ArrayList<Dier> LoadAllBirds(){
		openConn();
		
		String load = "SELECT soort FROM animals.animals where animal_type = 3";
		
		ArrayList<Dier> vogels = new ArrayList<>();
		
		try {
			stmt = conn.createStatement();
			ResultSet rs = stmt.executeQuery(load);
			
			while(rs.next()){
				if(rs.getString("soort").equals("Pelikaan")){
					if(pelikaanteller >= 1){
						
					}
					else{
						VogelLijst.getInstance().addMammels(new Pelikaan());
						pelikaanteller++;
					}
					
				}
				else{
					System.out.println("Geen Pelikaan");
				}
				
			}

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		closeConn();
		return vogels;
	}


}
